import request from "@/utils/request";

export function getBookCategoryList(data) {
  return request({
    url: "/category",
    method: "get",
    params: data
  });
}
export function getBookCategoryInfo(categoryId) {
  return request({
    url: `/category/${categoryId}`,
    method: "get"
  });
}
export function getBookCategoryChildrenInfo(id) {
  return request({
    url: `/categorys/${id}`,
    method: "get"
  });
}
export function addBookCategoryInfo(data) {
  return request({
    url: "/category",
    method: "post",
    data: data
  });
}
export function editBookCategoryInfo(data) {
    console.log(data);
  return request({
    url: '/category/'+data.id,
    method: "put",
    data: data.data
  });
}
export function delBookCategoryInfo(id) {
  return request({
    url: `/category/${id}`,
    method: "delete"
  });
}
